/*

This script runs the code to create tables and figures from the disclosed output


Directions:

1.  Create a master directory that contains the following subdirectories:
	a) data
	b) input_data
	c) output 
	d) public_programs
	
2. Copy this script and the public_programs to the public_programs directory

3. Copy the input data to the input_data directory

4. Run this script
*/

*1) Make and Set directories
*******************************************************  
  /* YOU MUST PUT IN THE MAIN DIRECTORY PATH HERE BELOW */

cd "YOUR PATH HERE\Replication"


/*
 You must make the following directories:
  input: place afft_v5 in this directory (this is the direct output from the Census programs and disclosure)
  programs: place all public replication programs in this directory
*/
  
*make directories for final output and intermediate input files  
 mkdir output 
 mkdir data


global figs "output"
global input "input"
global programs "code"
global data "data"
global output "output"

*name of output file for main paper tables
global outfile "output\gvc_tables.xls"
global app_tables "output\appendix_tables.xls"


******************************************************* 


*Make Appendix Table A.1 (aggregate data by MNE status and US Manuf Status)
do $programs/make_mne_appendix_table1.do

*Make Appendix Tables A.2-A.5 (aggregate and manuf sample stats and trade stats)
do $programs/make_appendix_tables_A2_A5.do

*Make Appendix Table A.8 (import flows by MNE status and product type -- produced by firm in US, purchased as input in US, both produced and input, neither)
do $programs/make_import_flow_types_01.do


